package main

import (
	beego "github.com/beego/beego/v2/server/web"
	"github.com/beego/beego/v2/server/web/filter/cors"
	"im/initialize"
	_ "im/routers"
)

func main() {

	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
		AllowAllOrigins:  false,
		AllowCredentials: false,
		AllowOrigins:     []string{"*"},
		AllowMethods:     []string{"*"},
		AllowHeaders:     []string{"*", "Access-Control-Allow-Origin"},
		ExposeHeaders:    nil,
		MaxAge:           0,
	}))

	initialize.InitMySQL()

	beego.Run()
}
